from pygame.surface import Surface

from libs.ZDisplay import ZDisplay
from libs.fun import create_image_alpha , create_image


class ZImage ( ZDisplay ) :
    def __init__ ( self , father , image_src , alpha = False ) :
        super ( ZImage , self ).__init__ ( father )
        if isinstance ( image_src , Surface ) :
            self.image = image_src
        else :
            if not alpha :
                self.image = create_image_alpha ( image_src )
            else :
                self.image = create_image ( image_src , alpha )
